package cn.yx.user.service.impl;

import cn.yx.common.mybatis.service.AbstractMybatisPlusService;
import cn.yx.user.cond.UserAccountCond;
import cn.yx.user.dos.UserAccountDo;
import cn.yx.user.dto.UserAccountDto;
import cn.yx.user.mapper.UserAccountMapper;
import cn.yx.user.mapping.UserAccountMapping;
import cn.yx.user.service.UserAccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>UserAccountService用户账户服务接口实现类</p>
 *
 * @author Wgssmart
 */
@Service
@Slf4j
public class UserAccountServiceImpl
        extends AbstractMybatisPlusService<UserAccountDo,
        UserAccountDto,
        UserAccountCond,
        Long,
        UserAccountMapper>
        implements UserAccountService {

    private final UserAccountMapper userAccountMapper;

    public UserAccountServiceImpl(UserAccountMapper userAccountMapper) {
        super(userAccountMapper, UserAccountMapping.INSTANCE);
        this.userAccountMapper = userAccountMapper;
    }

    @Override
    @Cacheable(key = "#id", cacheNames = "yx-user#24H", unless = "#result == null")
    public UserAccountDto getOne(Long id) {
        return super.getOne(id);
    }
}
